package com.lxhotel.agentmcp.controller;

import com.lxhotel.agentmcp.domain.request.LoginRequest;
import com.lxhotel.agentmcp.domain.R;
import com.lxhotel.agentmcp.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * This class function is xxx.
 *
 * @author yangbo
 * @date 2025/09/24
 */
@RestController
@RequestMapping("/api/login")
public class LoginController {

    @Autowired
    UserService userService;

    @RequestMapping( method = RequestMethod.POST)
    @ResponseBody
    public R doLogin(@RequestBody LoginRequest request) {
        return userService.doLogin(request);
    }
}
